package com.huobao.yunying.adapters;

import com.huobao.yunying.entity.Partner_OrderList;
import com.huobao.zhangying.R;

import android.content.Context;
import android.text.TextUtils;
import android.widget.TextView;
import joanzapata.android.BaseAdapterHelper;
import joanzapata.android.QuickAdapter;

public class Adapter_Dingdan_List extends QuickAdapter<Partner_OrderList> {

	public Adapter_Dingdan_List(Context context) {
		super(context, R.layout.item_partner_orderlist);
	}

	@Override
	protected void convert(BaseAdapterHelper arg0, Partner_OrderList arg1) {
		TextView tv_username = arg0.getView(R.id.tv_username);
		TextView tv_tel = arg0.getView(R.id.tv_tel);
		TextView tv_price = arg0.getView(R.id.tv_price);
		TextView tv_time = arg0.getView(R.id.tv_time);
		TextView tv_status = arg0.getView(R.id.tv_status);
		TextView tv_gonghuoshang = arg0.getView(R.id.tv_gonghuoshang);
		TextView tv_more = arg0.getView(R.id.tv_more);
		tv_username.setText("买家：" + arg1.user_name);
		tv_tel.setText(arg1.phone_mob);
		tv_price.setText("总价：￥" + arg1.goods_amount);
		String time = "";
		if (TextUtils.isEmpty(arg1.add_time) == false) {
			time = arg1.add_time;
		}
		tv_time.setText(time);
		tv_gonghuoshang.setText("供货商：" + arg1.store_name);
		int status = Integer.parseInt(arg1.status);
		switch(status){
		//[0已取消 11待付款 10已提交 20待发货 30已发货 40已完成]
		case 0:
			tv_status.setText("已取消");
			break;
		case 11:
			tv_status.setText("待付款");
			break;
		case 10:
			tv_status.setText("已提交 ");
			break;
		case 20:
			tv_status.setText("待发货");
			break;
		case 30:
			tv_status.setText("已发货");
			break;
		case 40:
			tv_status.setText("已完成");
			break;
		}
	}

}
